package com.ruogu.codegeneration.model.dto.chathistory;

import com.ruogu.codegeneration.common.PageRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 对话历史查询请求
 *
 * @author ruogu
 */
@Data
@Schema(description = "对话历史查询请求")
@EqualsAndHashCode(callSuper = true)
public class ChatHistoryQueryRequest extends PageRequest implements Serializable {

    /**
     * 对话历史编号
     */
    @Schema(description = "对话历史编号", example = "1")
    private Long id;

    /**
     * 消息内容（模糊查询）
     */
    @Schema(description = "消息内容（模糊查询）", example = "Hello")
    private String message;

    /**
     * 消息类型
     */
    @Schema(description = "消息类型", example = "user", allowableValues = {"user", "ai"})
    private String messageType;

    /**
     * 应用ID
     */
    @Schema(description = "应用ID", example = "1")
    private Long appId;

    /**
     * 创建用户ID
     */
    @Schema(description = "创建用户ID", example = "1")
    private Long userId;

    /**
     * 游标查询 - 上次查询的最后一条记录的创建时间
     * 用于分页，获取早于此时间的记录
     */
    @Schema(description = "游标查询", example = "1")
    private LocalDateTime lastCreateTime;

    @Serial
    private static final long serialVersionUID = 1L;
}
